//引入封装好的请求方式
import {
  get,
  post
} from './index'


/*菜单管理 */
//菜单列表
export const getMenuList = () => get('/menulist', {
  istree: true
})
//菜单的添加
export const menuAdd = data => post('/menuadd', data)
//菜单的删除
export const menuDel = (data) => post("/menudelete", data);
//菜单的修改
export const menuEdit = (data) => post("/menuedit", data);
//获取菜单的一条数据
export const getMenuInfo = (data) => get("/menuinfo", data);
/* ============角色管理============== */
//角色列表
export const getRoleList = () => get("/rolelist");
//角色的添加
export const roleAdd = (data) => post("/roleadd", data);
//角色的删除
export const roleDel = (data) => post("/roledelete", data);
//角色的修改
export const roleEdit = (data) => post("/roleedit", data);
//获取角色的一条数据
export const getRoleInfo = (data) => get("/roleinfo", data);
/* =========管理员接口=========== */
//管理员列表
export const userlist = params => get('/userlist', params)
//管理员的添加
export const useradd = data => post('/useradd', data)
//管理员的删除
export const userdelete = data => post('/userdelete', data)
//管理员的编辑
export const useredit = data => post('/useredit', data)
//管理员获取（一条）
export const userinfo = params => get('/userinfo', params)
//管理员总数查询
export const usercount = () => get('/usercount')
//管理员的登录
export const userlogin = data => post('/userlogin', data)
/* =============商品分类管理=============== */
// 封装一个分类添加的接口
export const cateAdd = data=>post('/cateadd',data,true)
// 封装一个分类列表的接口
export const cateList = data=>get('/catelist',data)
// 封装一个分类删除的接口
export const cateDel = data=>post('/catedelete',data)
// 封装一个分类列表的接口 一条数据
export const cateInfo = data=>get('/cateinfo',data)
// 封装一个分类编辑的接口
export const cateEdit = data=>post('/cateedit',data,true)
/* =========商品规格属性接口=========== */
//商品规格属性列表
export const specslist = params=>get('/specslist',params)
//商品规格属性的添加
export const specsadd =data=>post('/specsadd',data)
//商品规格属性的删除
export const specsdelete =data=>post('/specsdelete',data)
//商品规格属性的编辑
export const specsedit =data=>post('/specsedit',data)
//商品规格属性获取（一条）
export const specsinfo =params=>get('/specsinfo',params)
//商品规格属性总数查询
export const specscount =()=>get('/specscount')
/* =========商品接口=========== */
//商品列表
export const goodslist = params=>get('/goodslist',params)
//商品的添加
export const goodsadd =data=>post('/goodsadd',data,true)
//商品的删除
export const goodsdelete =data=>post('/goodsdelete',data)
//商品的编辑
export const goodsedit =data=>post('/goodsedit',data,true)
//商品获取（一条）
export const goodsinfo =params=>get('/goodsinfo',params)
//商品总数查询
export const goodscount =()=>get('/goodscount')
/* =====会员管理==== */
//会员列表** 
export const memberlist = ()=>get("/memberlist")
// 会员获取(一条)
export const memberinfo = params=>get("/memberinfo",params)
//会员修改
export const memberedit =data=>post("/memberedit",data)
/* ==============轮播图管理 ==============*/
//轮播图添加
export const banneradd =data=>post("/banneradd",data,true)
//轮播图列表
export const bannerlist =()=>get("/bannerlist")
//轮播图获取(一条)
export const bannerinfo =parmas=>get("/bannerinfo",parmas)
//轮播图修改
export const banneredit =data=>post("/banneredit",data,true)
//轮播图删除
export const bannerdelete =data=>post("/bannerdelete",data)
/* ================限时秒杀管理============== */
//限时秒杀添加** 
export const seckadd =data=>post("/seckadd",data)
//限时秒杀列表**
export const secklist =()=>get("/secklist")
//限时秒杀获取（一条）
export const seckinfo =params=>get("/secklist",params)
//限时秒杀修改
export const seckedit =data=>post("/seckedit",data)
// 限时秒杀删除
export const seckdelete =data=>post("/seckdelete",data)